package ch.ethz.fcl.metrobuzz.render.techniques.colors;

public class MBColor {
	private float h, s, v;

	public MBColor() {
		h = 0;
		s = 1;
		v = 1;
	}

	public MBColor(float[] hsv) {
		h = hsv[0];
		s = hsv[1];
		v = hsv[2];
	}

	public MBColor(float h, float s, float v) {
		this.h = h;
		this.s = s;
		this.v = v;
	}

	/**
	 * @param h
	 * @param s
	 * @param v
	 * @return
	 */
	public MBColor transformHSV(float h, float s, float v) {
		float newh = (this.h + h + 360) % 360;
		float news = s * this.s;
		float newv = v * this.v;

		return new MBColor(newh, news, newv);
	}

	public float[] getRGB() {
		return MBColorFactory.hsvToRGB(h, s, v);
	}

	public float[] getHSV() {
		float[] hsv = { h, s, v };
		return hsv;
	}
}
